lock=0
m4a1={3,4,4,5,4,4,3}
m762={4,5,6,6,6,5,4}
y_stand={4,5,6,6,6,5,4}
function OnEvent(event, arg)
	if(event=="PROFILE_ACTIVATED")then
		EnablePrimaryMouseButtonEvents(true)
	end
	if(event=="MOUSE_BUTTON_PRESSED" and arg==4)then
		OutputLogMessage("开启\n")
		lock=1
	end
	if(event=="MOUSE_BUTTON_PRESSED" and arg==5)then
		OutputLogMessage("关闭\n")
		lock=0
	end
	if(IsKeyLockOn("numlock"))then
		y_stand=m762
	end
	if(not(IsKeyLockOn("numlock")))then
		y_stand=m4a1
	end
	OutputLogMessage("Event: "..event.." Arg: "..arg.." lock: "..lock.." y1: "..y_stand[1].."\n")
--***********************************************************
--***********************************************************
	if(event=="MOUSE_BUTTON_PRESSED" and arg==1 and lock==1)then
		cx=1
		t=1
		while true do
			OutputLogMessage("计数器:%d 下压:%d\n",cx, y_stand[t])
			MoveMouseRelative(0,y_stand[t])
			Sleep(10)
			cx=cx+1
			if(cx>=40)then
				cx=1
				t=t+1
			end
			if(t>=#y_stand)then
				t=1
			end
			if(not IsMouseButtonPressed(1) or lock==0)then
				break
			end
		end
		OutputLogMessage("结束\n")
	end
end
